<div id="users">
<? echo $adminMenu->users(); ?>
<h2><?php __('USERS_ADMIN_TITLE');?> (<? echo $html->link(__('new user',true),array('action'=>'add')) ?>)</h2>
<? echo $form -> create(array('action'=>'delete_users')); ?>

<table cellpadding="3" cellspacing="1" width="100%">
<tr>
	<td width="7%"></td>
	<td></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
</tr>
<tr class="table_head">
	<td colspan="3" class="first-top">
		<? echo $pagination -> create(null,'users'); ?>
	</td>
	<td colspan="4" class="last-top">
		<? __('SORT_BY'); ?>: <?php echo $paginator->sort(__('LOGIN',true),'username');?> <?php echo $paginator->sort(__('USERNAME',true),'name');?>
	</td>
</tr>
<tr>
	<th><? __('ACTION'); ?></th>
	<th><? __('USERNAME'); ?></th>
	<th><? __('LOGIN'); ?></th>
	<th><? __('USER_ARTICLES'); ?></th>
	<th><? __('USER_NEWS'); ?></th>
	<th><? __('USER_COMMENTS'); ?></th>
	<th><? __('DELETE'); ?> <input type="checkbox" onclick="checkAll(this,'UserDeleteUsersForm')"/></th>
</tr>
<?php
$i = 0;
foreach ($users as $user):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<? echo $html->link($html->image('edit.png',array('alt'=>__('EDIT', true))),array('action'=>'edit', $user['User']['id']),array('title'=>__('EDIT',true)),null,false); ?> 
			<? echo $html->link($html->image('bin.png',array('alt'=>__('DELETE', true))), array('action'=>'delete', $user['User']['id']),array('title'=>__('DELETE',true)), __('DELETE_ITEM', true).' #' . $user['User']['name'],false); ?>
                        <? echo $html->link($html->image('key.png',array('alt'=>__('Change password', true))), array('action'=>'change_password', $user['User']['id']),array('title'=>__('Change password',true)),null,false); ?>
		</td>
		<td>
			<?php echo $html->link($user['User']['name'],array('action'=>'edit',$user['User']['id'])); ?>
		</td>
		<td>
			<?php echo $user['User']['username']; ?>
		</td>
		<td>
			<?php echo count($user['Article']);?>
		</td>
		<td>
			<?php echo count($user['News']); ?>
		</td>
		<td>
			<?php echo count($user['Comment']); ?>
		</td>
		<td  align="center">
			<input type="checkbox" name="data[UsersDelete][]" value="<? echo $user['User']['id']; ?>"/>
		</td>
	</tr>
<?php endforeach; ?>
<tr class="table_head">
	<td colspan="3" class="first-bottom">
		<? echo $pagination -> create(null,'users'); ?>
	</td>
	<td colspan="4" class="last-bottom">
		<? __('SORT_BY'); ?>: <?php echo $paginator->sort(__('LOGIN',true),'username');?> <?php echo $paginator->sort(__('USERNAME',true),'name');?>
	</td>
</tr>
</table>
<div style="float: right; margin: 1em;"><? echo $form -> submit(__('DELETE',true)); ?></div>
</form>
</div>